﻿using System;
using Telerik.Web.UI;

public partial class ltMan_leaders_leaderList : AdminBasePage
{
    ltModel.BLL.ProjectBLL projectBLL = new ltModel.BLL.ProjectBLL();

    protected void Page_Load(object sender, EventArgs e)
    {
        SqlPager pager = new SqlPager("lt_Project", "ProjectID", "*");
        if (!string.IsNullOrEmpty(sName.Text))
            pager.Where = " ProjectName like '%" + sName.Text.Replace("'", "''") + "%'";
        pager.OrderBy = "Approved asc,RegistrationDeadLine desc , ProjectID desc";
        RadGridBinder.Create(RadGrid1, pager);
    }

    protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        int id = int.Parse(GridCommander.ExtractValue(e, "ProjectID"));
        //OperateLog.AddSuccessLog(CurrentUser.user_id, Request.UserHostAddress, "申请申请信息-删除>" + lead.GetModel(id).dwfzr);
        projectBLL.Delete(id);
    }

    protected void b1_Click(object sender, EventArgs e)
    {
        RadGrid1.Rebind();
    }

    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "Verify")
        {
            string projectIDs = GridCommander.JoinValues(e.Item.OwnerTableView.DataKeyValues, RadGrid1.SelectedIndexes);
            projectBLL.UpdateStatus(projectIDs, e.CommandArgument.ToString());
            RadGrid1.Rebind();
        }
    }
}